﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace KTSonline
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Global.currentpage = Global.Pages.Home;

            KTSonlineDataContext db = new KTSonlineDataContext();

            #region MAY_ANH
            var rs = db.NHA_SAN_XUATs.Where(c=>c.MAY_ANHs.Count > 0);
            Repeater1.DataSource = rs;
            Repeater1.DataBind();

            Repeater1_3.DataSource = Repeater1_2.DataSource = db.THAM_SO_GIAs.Where(c => c.mode == 1);
            Repeater1_2.DataBind();
            Repeater1_3.DataBind();
            #endregion

            #region MAY_QUAY_PHIM
            var rs2 = db.NHA_SAN_XUATs.Where(c => c.MAY_QUAY_PHIMs.Count > 0);
            Repeater2.DataSource = rs2;
            Repeater2.DataBind();

            Repeater2_3.DataSource = Repeater2_2.DataSource = db.THAM_SO_GIAs.Where(c => c.mode == 2);
            Repeater2_2.DataBind();
            Repeater2_3.DataBind();
            #endregion

            #region MAY_NGHE_NHAC
            var rs3 = db.NHA_SAN_XUATs.Where(c => c.MAY_NGHE_NHACs.Count > 0);
            Repeater3.DataSource = rs3;
            Repeater3.DataBind();

            Repeater3_3.DataSource = Repeater3_2.DataSource = db.THAM_SO_GIAs.Where(c => c.mode == 3);
            Repeater3_2.DataBind();
            Repeater3_3.DataBind();
            #endregion

            #region LOA
            var rs4 = db.NHA_SAN_XUATs.Where(c => c.LOAs.Count > 0);
            Repeater4.DataSource = rs4;
            Repeater4.DataBind();

            Repeater4_3.DataSource = Repeater4_2.DataSource = db.THAM_SO_GIAs.Where(c => c.mode == 4);
            Repeater4_2.DataBind();
            Repeater4_3.DataBind();
            #endregion

            #region TAI_NGHE
            var rs5 = db.NHA_SAN_XUATs.Where(c => c.TAI_NGHEs.Count > 0);
            Repeater5.DataSource = rs5;
            Repeater5.DataBind();

            Repeater5_3.DataSource = Repeater5_2.DataSource = db.THAM_SO_GIAs.Where(c => c.mode == 5);
            Repeater5_2.DataBind();
            Repeater5_3.DataBind();
            #endregion

            #region MAY_TINH_BANG
            var rs6 = db.NHA_SAN_XUATs.Where(c => c.MAY_TINH_BANGs.Count > 0);
            Repeater6.DataSource = rs6;
            Repeater6.DataBind();

            Repeater6_3.DataSource = Repeater6_2.DataSource = db.THAM_SO_GIAs.Where(c => c.mode == 6);
            Repeater6_2.DataBind();
            Repeater6_3.DataBind();
            #endregion

            #region O_CUNG
            var rs7 = db.NHA_SAN_XUATs.Where(c => c.O_CUNGs.Count > 0);
            Repeater7.DataSource = rs7;
            Repeater7.DataBind();

            Repeater7_3.DataSource = Repeater7_2.DataSource = db.THAM_SO_GIAs.Where(c => c.mode == 7);
            Repeater7_2.DataBind();
            Repeater7_3.DataBind();
            #endregion

            #region PHU_KIEN
            var rs8 = db.NHA_SAN_XUATs.Where(c => c.PHU_KIENs.Count > 0);
            Repeater8.DataSource = rs8;
            Repeater8.DataBind();

            Repeater8_3.DataSource = Repeater4_2.DataSource = db.THAM_SO_GIAs.Where(c => c.mode == 8);
            Repeater8_2.DataBind();
            Repeater8_3.DataBind();
            #endregion
        }
    }
}
